<#include "header.html">




<div class="container ">
    <div class="section">


        <div class="row">
            <div class="col s12 l9">





                <div class="row">
                    <div class="col s12 m12">
                        <div class="card hoverable">

                            <div class="card-action">
                                <a>最新的帖子</a>

                            </div>

<!--                            posts-->
                            <ul class="collection">

                                <#list vos as vo>
                                <li class="collection-item avatar">
                                    <span class="new badge blue" data-badge-caption="回复">${vo.post.commentCount}</span>
                                    <span class="new badge red" data-badge-caption="赞">${vo.likeCount}</span>
                                    <a href="/user/${vo.user.id}"><img src="${vo.user.headUrl}" alt="" class="circle"></a>
                                    <a href="/post/${vo.post.id}"><span class="title truncate">${vo.post.title}</span></a>
                                    <p class="thin"><a href="/user/${vo.user.id}">${vo.user.name}</a>  •  创建于 ${vo.post.createdDate?datetime}

                                        <#if user?? && user.id == vo.post.userId>
                                        •
                                        <a href="javascript:$.post('/post/remove',{id:${vo.post.id}}, function(data){console.log(data);window.location.reload();});" class="modal-action modal-close waves-effect  "> 删除</a>
                                    </#if>

                                    </p>

                                </li>
                                </#list>

                            </ul>




                            <div class="card-content">
                                <!-- 分页 -->
                                <ul class="pagination center">
                                    <#if prePId??>
                                        <li class="waves-effect"><a href="/?pId=${prePId}"><i class="material-icons">chevron_left</i></a></li>
                                    </#if>

                                    <#if nextPId??>
                                        <li class="waves-effect"><a href="/?pId=${nextPId}"><i class="material-icons">chevron_right</i></a></li>
                                    </#if>

                                </ul>

                            </div>
                        </div>
                    </div>
                </div>







            </div>

            <div class="col s12 l3">
                <div class="row">
                    <div class="col s12 m12">
                        <div class="card hoverable">
                            <div class="card-action ">
                                <a>热</a>

                            </div>
                            <div class="collection">
                                <#list hots as vo>
                                    <a href="/post/${vo.id}" class="collection-item truncate">
                                        <span class="new badge blue" data-badge-caption="回复">${vo.commentCount}</span>
                                        ${vo.title}</a>

                                </#list>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col s12">
                        <div class="card hoverable">


                            <div class="card-action ">
                                <a href="#">广告</a>
                            </div>


                            <div class="card-image waves-effect waves-block waves-light">
                                <img class="activator" src="/images/ad.png">
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>


    </div>

</div>






<#include "footer.html">